<template>
  <div id="app">
    <el-container>
      <el-header>PC后台管理系统</el-header>
      <el-container>
        <el-aside width="200px">
            <el-row class="tac">
              <el-col :span="24">
                <el-menu
                  default-active="this.$route.path"
                  class="el-menu-vertical-demo"
                  @open="handleOpen"
                  @close="handleClose" router>
                  <el-submenu index="1">
                    <template slot="title">
                      <i class="el-icon-location"></i>
                      <span>PC管理</span>
                    </template>
                    <el-menu-item-group>
                      <template slot="title">基础管理</template>
                      <el-menu-item index="1-1" @click="users()">用户管理</el-menu-item>
                      <el-menu-item index="1-2" @click="product()">商品管理</el-menu-item>
                      <el-menu-item index="1-3" @click="procate()">商品分类管理</el-menu-item>
                    </el-menu-item-group>
                    <el-menu-item-group title="后台管理">
                      <el-menu-item index="1-3">购物车</el-menu-item>
                    </el-menu-item-group>
                    <el-submenu index="1-4">
                      <template slot="title">订单管理</template>
                      <el-menu-item index="1-4-1" @click="order()">选项1</el-menu-item>
                    </el-submenu>
                  </el-submenu>
                  <el-menu-item index="2" @click="login()">
                    <i class="el-icon-menu"></i>
                    <span slot="title">登录</span>
                  </el-menu-item>
                  <el-menu-item index="3" disabled>
                    <i class="el-icon-document"></i>
                    <span slot="title">角色</span>
                  </el-menu-item>
                  <el-menu-item index="4" @click="recyc()">
                    <i class="el-icon-setting"></i>
                    <span slot="title">商品回收站</span>
                  </el-menu-item>
                </el-menu>
              </el-col>
            </el-row>
        </el-aside>
        <el-main>
          <router-view> </router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
export default {
  name: 'App',
  methods: {
      handleOpen(key, keyPath) {
        console.log(key, keyPath);
      },
      handleClose(key, keyPath) {
        console.log(key, keyPath);
      },
      product(){
        this.$router.push("/Product");
      },
      users(){
        this.$router.push("/Users");
      },
      recyc(){
        this.$router.push("/Recyc");
      },
      procate()
      {
        this.$router.push("/Procate");
      },
      order()
      {
        this.$router.push("/Order");
      },
      login()
      {
        this.$router.push("/Login");
      }
  }
}
</script>

<style>
/* #app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
} */

.el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  /* .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 88px;
  } */
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  }

</style>
